﻿using Microsoft.AspNetCore.Razor.TagHelpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace RazorWebApp.Utils.RazorExtension
{
    [HtmlTargetElement("student")]
    public class StudentTagHelper:TagHelper
    {
        public int Age { get; set; }

        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            // base.Process(context, output);
            output.TagName = "div";//对应的html标签
            output.Attributes.Add("id","007");
            output.Attributes.Add("name","007");
            output.Attributes.Add("age",Age);
            output.PreContent.SetContent("扩展TagHelper输出的内容！");
        }
    }
}
